package mobilesearch.receiver;

import java.util.ArrayList;
import mobilesearch.data.ContactsData;
import mobilesearch.ui.OnSearchResultListener;

public class ContactsReceiver {

	private static final String TAG = "ContactsReceiver";
	private ArrayList<ContactsData> contactsList;
	private OnSearchResultListener listener;
	
	public ContactsReceiver(ArrayList<ContactsData> contactsList, OnSearchResultListener listener) {
		this.contactsList = contactsList;
		this.listener = listener;
	}
	
	public void processContactsData(){
		int size = this.contactsList.size();
		for(int i = 0; i < size; i++){
			ContactsData data = this.contactsList.get(i);
			String displayName = data.getDisplayName();
			String phoneNumber = data.getPhoneNumber();
			this.listener.onReceiveContactsData(displayName, phoneNumber);
		}
	}
}
